package com.chat.xx.controller;

import com.chat.xx.beam.common.Message;
import com.chat.xx.beam.common.PageBeam;
import com.chat.xx.beam.vo.add.ContentAdd;
import com.chat.xx.beam.vo.query.ContentQuery;
import com.chat.xx.server.ContentServer;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/content")
public class ContentController {
    private final ContentServer contentServer;

    public ContentController(ContentServer contentServer) {
        this.contentServer = contentServer;
    }

    @PostMapping("/add")
    public Message<Boolean> add(@RequestBody ContentAdd content){
        return contentServer.add(content);
    }
    @PostMapping("/list")
    public Message<PageBeam<ContentQuery>> list(@RequestBody ContentQuery contentQuery){
        return contentServer.list(contentQuery);
    }
}
